package net.jxiny.oschina.synthetical.Adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import net.jxiny.oschina.R;
import net.jxiny.oschina.synthetical.enyity.Answer;

import java.util.List;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

public class AnswerAdapter extends BaseQuickAdapter<Answer, BaseViewHolder> {

    public AnswerAdapter(int layoutResId, @Nullable List<Answer> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, Answer item) {
        helper.setText(R.id.answer_title,item.getTitle());
        helper.setText(R.id.answer_time,item.getPubDate());
        helper.setText(R.id.answer_author,item.getAuthor());
        helper.setText(R.id.answer_Count,item.getAnswerCount());
        ImageView imageView = helper.getView(R.id.answer_picture);
        Glide.with(mContext).load(item.getPortrait()).into(imageView);



    }
}
